package com.zhx.common.chat.service.strategy.mark;


import com.zhx.common.chat.domain.enums.MessageMarkTypeEnum;
import org.springframework.stereotype.Component;

@Component
public class DisLikeStrategy extends AbstractMsgMarkStrategy{
    @Override
    protected MessageMarkTypeEnum getTypeEnum() {
        return MessageMarkTypeEnum.DISLIKE;
    }

    //如果点踩了，我们就要取消点赞
    @Override
    public void doMark(Long uid, Long msgId) {
        //点踩
        super.doMark(uid, msgId);
        // 取消点赞的逻辑实现，根据消息标记类型使用对应的策略执行取消点赞操作
        MsgMarkStrategyFactory.getStrategyNoNull(MessageMarkTypeEnum.LIKE.getType())
                .unMark(uid, msgId);
    }
}
